package o;

import com.huawei.appgallery.foundation.card.base.bean.AppInfoBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import com.huawei.appgallery.wishlist.api.WishInfo;
import com.huawei.appgallery.wishlist.bean.WishDeleteInfo;
import com.huawei.appgallery.wishlist.bean.WishInfoListCache;
import java.util.ArrayList;
import java.util.List;

public class dda {
    private static dda ˎ;
    private List<WishDeleteInfo> ˏ = new ArrayList();

    public static void ˏ() {
        ˊ(new d(null));
    }

    public static void ˊ(IServerCallBack iServerCallBack) {
        cfw.ˎ(new dcq(-1), iServerCallBack);
    }

    public static synchronized dda ॱ() {
        dda o_dda;
        synchronized (dda.class) {
            if (ˎ == null) {
                ˎ = new dda();
            }
            o_dda = ˎ;
        }
        return o_dda;
    }

    public List<WishDeleteInfo> ˎ() {
        if (CollectCheck.isEmpty(this.ˏ)) {
            return null;
        }
        List<WishDeleteInfo> arrayList = new ArrayList(this.ˏ);
        this.ˏ.clear();
        return arrayList;
    }

    public void ˏ(List<WishDeleteInfo> list) {
        this.ˏ.clear();
        if (!CollectCheck.isEmpty((List) list)) {
            this.ˏ.addAll(list);
        }
    }

    public void ˋ(List<WishInfo> list) {
        WishInfoListCache.ˊ().ˎ(false);
        if (!CollectCheck.isEmpty((List) list)) {
            for (WishInfo wishInfo : list) {
                if (wishInfo.ˋ() != 3) {
                    int i;
                    String str = "";
                    if (CollectCheck.isEmpty(wishInfo.ʻ()) || wishInfo.ʻ().get(0) == null) {
                        i = 0;
                    } else {
                        str = ((AppInfoBean) wishInfo.ʻ().get(0)).ˏॱ();
                        i = ddk.ˏ(((AppInfoBean) wishInfo.ʻ().get(0)).ʻ());
                    }
                    WishInfoListCache.ˊ().ˎ(wishInfo.ˏ(), wishInfo.ˊ(), str, i, wishInfo.ʼ(), false);
                }
            }
            if (dch.ˎ.ˎ()) {
                dch.ˎ.ˎ("WishListManager", "unrealizedWishInfos size :" + WishInfoListCache.ˊ().ˎ());
            }
        }
        WishInfoListCache.ˊ().ॱ();
    }
}
